package com.ytc.service;

import com.ytc.dto.BookFeiLeiDto;
import com.ytc.model.Book;
import com.ytc.model.Booklist;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

@FeignClient(value = "service-provider")
public interface BooklistService {

    //zzm 作者创建作品
    @RequestMapping("addBookList")
    void addBookList(@RequestBody Booklist booklist,@RequestParam("kId") String kId);

    //柴晓颖：查询书籍信息去修改
    @RequestMapping("queryBookListByBookid")
    Booklist queryBookListByBookid(@RequestParam("bookid") Integer bookid);


    //柴晓颖：删除书籍
    @RequestMapping("delBook")
    void delBook(@RequestParam("bookid") Integer bookid);

    //张阔：分类查询书籍
    @RequestMapping("queryBookListByDto")
    List<Booklist> queryBookListByDto(@RequestBody BookFeiLeiDto dto);

    //张阔：查询总字数
    @RequestMapping("querySumNum")
    Long querySumNum(@RequestParam("blId") Integer blId);

    //张阔：查询书籍目录及其信息
    @RequestMapping("queryBookById")
    Booklist queryBookById(@RequestParam("blId") Integer blId);

    //张阔：查询平均分
    @RequestMapping("queryAvgScore")
    Double queryAvgScore(@RequestParam("blId") Integer blId);

    //张阔：查询具体章节
    @RequestMapping("queryChapterById")
    Book queryChapterById(@RequestParam("bcid") Integer bcid, @RequestParam("blId")  Integer blId);

    //张阔：查询书籍更新日期
    @RequestMapping("queryNewDate")
    String queryNewDate(@RequestParam("blId")  Integer blId);

    //张阔：修改点击量
    @RequestMapping("updateBookCount")
    void updateBookCount(@RequestParam("bid")  Integer bid,@RequestParam("cid")  Integer cid);


    @RequestMapping("queryScountByUid")
    long queryScountByUid(@RequestParam("uId") Integer uId);

    @RequestMapping("queryAuthorBooks")
    List<String> queryAuthorBooks(@RequestParam("uId") Integer uId);

    //柴晓颖：通过作者查询对应的书籍
    @RequestMapping("queryBookListByAuthor")
    List<Booklist> queryBookListByAuthor(@RequestParam("uId") Integer uId);

    //柴晓颖：作者申请签约，修改状态
    @RequestMapping("applyQianyue")
    void applyQianyue(@RequestParam("blId") Integer blId);


}
